package com.zhy.baselibrary.adapter;

import android.graphics.Rect;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

// 自定义 ItemDecoration 类
public class VerticalSpaceItemDecoration extends RecyclerView.ItemDecoration {

    private final int verticalSpaceHeight;
    private final int count;

    // 构造函数，接收竖向间距值
    public VerticalSpaceItemDecoration(int verticalSpaceHeight, int count) {
        this.verticalSpaceHeight = verticalSpaceHeight;
        this.count = count;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
                               RecyclerView.State state) {
        outRect.bottom = verticalSpaceHeight;
    }
}